const express = require("express");
const  app = express();

app.use(express.static("./static"));
app.use(express.urlencoded({extended: false}));
app.use(express.json());

app.get("/",(req, res) => {
    console.log(req.query);
    console.log("-------------------");
    console.log(req.headers);
    res.send("Hi Ajax")
});

app.post("/ajax_post",((req, res) => {
    console.log(req.body);
    res.send("hi post");
}));

app.get("/get_json",(req, res) => {
    let user ={
        username: "Jack",
        password: "1hnfvsj9ru9ru"
    };
    console.log("-----");
    res.send("hello()");
})

app.listen(80,()=>{
    console.log("服务器运行");
})